{extend name="layout/base" /}
{block name="main"}
<link rel="stylesheet" href="__STATIC__/hsgcommon/divqt.css" type="text/css">
<link rel="stylesheet" href="__STATIC__/hsgcommon/commonqt.css" type="text/css">
<script src="__STATIC__/hsgcommon/common.js"></script>
<script src="__STATIC__/hsgcommon/bootbox.js"></script>
<link rel="stylesheet" href="__STATIC__/modal.css" type="text/css">
<script type="text/javascript" src="__STATIC__/modal.js"></script>
<script type="text/javascript" src="__STATIC__/js/laydate.js"></script>

<!--<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>-->
<script language="javascript">
    var mModal1 = new mModal({
        title: "",
        content: "<img style='margin-left: 7%' src='__STATIC__/qrcode.png'>",
        confirmText: "确认支付",
        cancelText: "取消支付",
        showClose: true,
        width: "17%",
        // showCancelButton: false,
        confirm: function () {
            mModal1.close();
            $('#form1').submit();
        },
        cancel: function () {
            mModal1.close();
        }
    });

    function OpenScript(url, width, height) {
        var win = window.open(url, "SelectToSort", 'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes');
    }

    function OpenDialog(sURL, iWidth, iHeight) {
        var oDialog = window.open(sURL, "_EditorDialog", "width=" + iWidth.toString() + ",height=" + iHeight.toString() + ",resizable=no,left=0,top=0,scrollbars=no,status=no,titlebar=no,toolbar=no,menubar=no,location=no");
        oDialog.focus();
    }

    function check() {
        if (document.form1.start_date.value === '') {
            swal("请填写入住日期信息");
            return false;
        }
        if (document.form1.start_date.value === document.form1.end_date.value) {
            swal("入住日期和离店日期不能相同");
            return false;
        }
        if (/^1[3|4|5|6|7|8|9][0-9]\d{8,8}$/.test(document.form1.phone.value) || /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/.test(document.form1.phone.value)) {
        } else {
            swal("联系电话必需电话格式");
            document.form1.phone.focus();
            return false;
        }
        if (!(/^\d{15}$|^\d{18}$|^\d{17}[xX]$/.test(document.form1.card_no.value))) {
            swal("身份证必需身份证格式");
            document.form1.card_no.focus();
            return false;
        }
        mModal1.renderDom();
    }
</script>


<div class="news">
    <div class="container">
        <div class="index-title txt-c">
            <em>你的梦想我很在意 更支持</em>
            <div class="line">
                <h3>客房预订</h3>
            </div>
        </div>
        <div class="news-list c">
            <ul>
                <script src="__STATIC__/jquery-1.11.3.min.js"></script>
                <script src="__STATIC__/sweetalert.min.js"></script>
                <script src="__STATIC__/x-sweetalert.js"></script>
                <link rel="stylesheet" type="text/css" href="__STATIC__/sweetalert.css">
                <form id="form1" name="form1" method="post" action="/order/save">
                    <input type='hidden' name="room_id" value='{$room.id}' />
                    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF"
                           style="border-collapse:collapse" class="newsline">
                        <tr>
                            <td>房型：</td>
                            <td><input type='text' value='{$room.name}' class="form-control" readonly/></td>
                        </tr>
                        <tr>
                            <td>可入住人数：</td>
                            <td><input type='text' value='{$room.people_count}' class="form-control" readonly/></td>
                        </tr>
                        <tr>
                            <td>床型：</td>
                            <td><input type='text' value='{$room.bed}' class="form-control" readonly/></td>
                        </tr>
                        <tr>
                            <td>房间号：</td>
                            <td>
                                {foreach $room['room_numbers'] as $index=>$room_number}
                                <input name="room_number" type='radio' value='{$room_number}' style="width: 20px" {$index==0?'checked':''}/> <span style="padding-right: 40px">{$room_number}</span>
                                {/foreach}
                            </td>
                        </tr>
                        <tr>
                            <td>单价：</td>
                            <td>
                                <input name='price' type='text' id='price' value='{$room.price}' class="form-control"
                                       readonly/>
                            </td>
                        </tr>
                        <tr>
                            <td>日期：</td>
                            <td>
                                <div class="layui-inline" id="check_date" lay-key="8">
                                    <input style="width: 125px" name="start_date" type="text" autocomplete="off" id="start_date"  class="form-control"
                                           placeholder="入住日期">
                                    <input style="width: 125px" name="end_date" type="text" autocomplete="off" id="end_date"  class="form-control"
                                           placeholder="离店日期">
                                </div>
                                <div style="margin-top:16px;">&nbsp;日期必填</div>
                            </td>
                        </tr>
                        <tr>
                            <td>联系电话：</td>
                            <td>
                                <input name='phone' type='text' id='phone' value='' class="form-control"/>
                                <div style="margin-top:16px;">&nbsp;必需电话格式</div>
                            </td>
                        </tr>
                        <tr>
                            <td>身份证：</td>
                            <td>
                                <input name='card_no' type='text' id='card_no' value='' class="form-control"/>
                                <div style="margin-top:16px;">&nbsp;必需身份证格式</div>
                            </td>
                        </tr>
                        <tr>
                            <td>姓名：</td>
                            <td>
                                <input name='full_name' type='text' id='full_name' value='' class="form-control"/>
                            </td>
                        </tr>

                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <input type="button" name="Submit" value="确定" onclick="return check();"
                                       class="content-form-signup"/>
                                <input type="reset" name="Submit2" value="重置" class="content-form-signup"/>
                            </td>
                        </tr>
                    </table>
                </form>


            </ul>
        </div>

    </div>
</div>

<script>
    laydate.render({
        elem: '#check_date',
        range: ['#start_date', '#end_date'],
        min: 0,
        max: 30
    });
</script>
{/block}
